home *** CD-ROM | disk | FTP | other *** search
/ Internet Info 1993 / Internet Info CD-ROM (Walnut Creek) (1993).iso / networking / ip / ka9q / osrc.arc / NETUSER.H < prev    next >
Encoding:
C/C++ Source or Header  |  1989-03-30  |  1.3 KB  |  49 lines

  1. /* Global structures and constants needed by an Internet user process */
  2. #ifndef    NCONN
  3.  
  4. #include "global.h"
  5.  
  6. #define    NCONN    20        /* Maximum number of open network connections */
  7.  
  8. extern int32 Ip_addr;    /* Our IP address */
  9. extern int Net_error;    /* Error return code */
  10. #define    NONE    0        /* No error */
  11. #define    CON_EXISTS    1    /* Connection already exists */
  12. #define    NO_CONN    2        /* Connection does not exist */
  13. #define    CON_CLOS    3    /* Connection closing */
  14. #define    NO_SPACE    4    /* No memory for TCB creation */
  15. #define    WOULDBLK    5    /* Would block */
  16. #define    NOPROTO        6    /* Protocol or mode not supported */
  17. #define    INVALID        7    /* Invalid arguments */
  18.  
  19. /* Codes for the tcp_open call */
  20. #define    TCP_PASSIVE    0
  21. #define    TCP_ACTIVE    1
  22. #define    TCP_SERVER    2    /* Passive, clone on opening */
  23.  
  24. /* Socket structure */
  25. struct socket {
  26.     int32 address;        /* IP address */
  27.     int16 port;        /* port number */
  28. };
  29. #define    NULLSOCK    (struct socket *)0
  30.  
  31. /* Connection structure (two sockets) */
  32. struct connection {
  33.     struct socket local;
  34.     struct socket remote;
  35. };
  36. #if    defined(__STDC__) || defined(__TURBOC__)
  37. int32 dresolve(char *name);
  38. int32 resolve(char *name);
  39. #else
  40. int32 dresolve();
  41. int32 resolve();
  42. #endif
  43.  
  44. int32 aton(),resolve();
  45. char *inet_ntoa(),*psocket();
  46.  
  47.  
  48. #endif    /* NCONN */
  49.